<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
                <html lang="zh-CN">
                <head>
                    <meta charset="utf-8">
                    <meta http-equiv="X-UA-Compatible" content="IE=edge">
                    <meta name="viewport" content="width=device-width, initial-scale=1">
                    <title>CMS管理系统</title>

                    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
                    <link rel="stylesheet" href="/Public/css/common.css">
                    
    <script type="text/javascript" src="/Public/ckfinder/ckfinder.js"></script>
    <style>
    body, html, iframe, #ckfinder {
    padding: 0;
    border: 0;

    width: 100%;
    height: 100%;
    overflow: hidden;
    }
    </style>

                </head>
                <body>

                <nav class="navbar navbar-default navbar-fixed-top col-md-10">
                    <div class="container-fluid nav_bg">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <div class="navbar-header">
                            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="<?php echo U('Index/index');?>">首页</a>
                        </div>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <ul class="nav navbar-nav">
                                <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
                                <li><a href="<?php echo U('Link/index');?>">友情链接管理</a></li>
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false">前端文件管理 <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('File/index');?>">文件管理</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('Article/show');?>">Finder</a></li>
                                    </ul>
                                </li>

                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false">内容管理 <span class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('Article/index');?>">文章列表</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('Category/index');?>">栏目管理</a></li>
                                    </ul>
                                </li>

                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                                       aria-expanded="false"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> 系统设置 <span
                                            class="caret"></span></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo U('System/config');?>">站点信息</a></li>
                                        <li role="separator" class="divider"></li>
                                        <li><a href="<?php echo U('User/password_edit');?>">密码修改</a></li>
                                    </ul>
                                </li>

                            </ul>


                            <ul class="nav navbar-nav navbar-right">
                                <li><a href="<?php echo U('File/destroy_cache');?>">清除缓存</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">尊敬的<?php echo ($user["username"]); ?> <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">Action</a></li>
                        <li><a href="#">Another action</a></li>
                        <li><a href="#">Something else here</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="<?php echo U('User/logout');?>">安全退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid">
    
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-8">
                    <div class="page-header">
                        <h1>Finder</h1>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default" style="height: 524px;">

                        <div id="ckfinder" style="margin-top:-38px;" ></div>

                        <div class="panel-body">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="/Public/js/jquery.min.js"></script>

<script src="/Public/bootstrap/js/bootstrap.min.js"></script>


    <script type="text/javascript">
        //<![CDATA[
        (function()
        {
            var config = {};
            var get = CKFinder.tools.getUrlParam;
            var getBool = function( v )
            {
                var t = get( v );

                if ( t === null )
                    return null;

                return t == '0' ? false : true;
            };

            var tmp;
            if ( tmp = get( 'configId' ) )
            {
                var win = window.opener || window;
                try
                {
                    while ( ( !win.CKFinder || !win.CKFinder._.instanceConfig[ tmp ] ) && win != window.top )
                        win = win.parent;

                    if ( win.CKFinder._.instanceConfig[ tmp ] )
                        config = CKFINDER.tools.extend( {}, win.CKFinder._.instanceConfig[ tmp ] );
                }
                catch(e) {}
            }

            if ( tmp = get( 'basePath' ) )
                CKFINDER.basePath = tmp;

            if ( tmp = get( 'startupPath' ) || get( 'start' ) )
                config.startupPath = decodeURIComponent( tmp );

            config.id = get( 'id' ) || '';

            if ( ( tmp = getBool( 'rlf' ) ) !== null )
                config.rememberLastFolder = tmp;

            if ( ( tmp = getBool( 'dts' ) ) !== null )
                config.disableThumbnailSelection = tmp;

            if ( tmp = get( 'data' ) )
                config.selectActionData = tmp;

            if ( tmp = get( 'tdata' ) )
                config.selectThumbnailActionData = tmp;

            if ( tmp = get( 'type' ) )
                config.resourceType = tmp;

            if ( tmp = get( 'skin' ) )
                config.skin = tmp;

            if ( tmp = get( 'langCode' ) )
                config.language = tmp;

            if ( typeof( config.selectActionFunction ) == 'undefined' )
            {
                // Try to get desired "File Select" action from the URL.
                var action;
                if ( tmp = get( 'CKEditor' ) )
                {
                    if ( tmp.length )
                        action = 'ckeditor';
                }
                if ( !action )
                    action = get( 'action' );

                var parentWindow = ( window.parent == window ) ? window.opener : window.parent;
                switch ( action )
                {
                    case 'js':
                        var actionFunction = get( 'func' );
                        if ( actionFunction && actionFunction.length > 0 )
                            config.selectActionFunction = parentWindow[ actionFunction ];

                        actionFunction = get( 'thumbFunc' );
                        if ( actionFunction && actionFunction.length > 0 )
                            config.selectThumbnailActionFunction = parentWindow[ actionFunction ];
                        break ;

                    case 'ckeditor':
                        var funcNum = get( 'CKEditorFuncNum' );
                        if ( parentWindow['CKEDITOR'] )
                        {
                            config.selectActionFunction = function( fileUrl, data )
                            {
                                parentWindow['CKEDITOR'].tools.callFunction( funcNum, fileUrl, data );
                            };

                            config.selectThumbnailActionFunction = config.selectActionFunction;
                        }
                        break;

                    default:
                        if ( parentWindow && parentWindow['FCK'] && parentWindow['SetUrl'] )
                        {
                            action = 'fckeditor' ;
                            config.selectActionFunction = parentWindow['SetUrl'];

                            if ( !config.disableThumbnailSelection )
                                config.selectThumbnailActionFunction = parentWindow['SetUrl'];
                        }
                        else
                            action = null ;
                }
                config.action = action;
            }

            // Always use 100% width and height when nested using this middle page.
            config.width = config.height = '100%';

            var ckfinder = new CKFinder( config );
            ckfinder.replace( 'ckfinder', config );
        })();
        //]]>
    </script>
 
</body>
</html>